<?php

namespace App\Http\Controllers;

use App\Http\Controllers\BaseController;
use App\Services\LiveService;
use Illuminate\Http\Request;

class LiveController extends BaseController
{
    public function __construct(LiveService $liveService)
    {
        $this->liveService = $liveService;
    }

    public function index()
    {
        $param = $this->validationParameter([
            'page|页码' => 'noRequire|number|default:1',
            'per_page|显示数量' => 'noRequire|number|default:30',
            'keyword|搜索条件' => 'noRequire',
        ]);

        $data = $this->liveService->getList($param);

        return $this->response->success($data);
    }

    public function show(Request $request)
    {
        $id = $request->input('id');
        $result = $this->liveService->getInfo($id);

        return $this->response->success($result);
    }

}
